<?php

    class logs extends CI_Controller {
    
        var $page_data = array();
        
        function __construct() {
            parent::__construct();
            if(!$this->session->userdata('logged_in') || !$this->session->userdata('admin')){
            	redirect('SluzobneCesty');
            }
            $this->load->model("logs_model");
        }
    	
		function index(){
			
			$this->page_data['logs'] = $this->getAll();
			$this->load->view('logs_view', $this->page_data);
			
		}
		
        public function add($person_id, $action) { 
            $this->logs_model->add($person_id, $action);
        }
        
        public function getAll() { 
            return $this->logs_model->getAll();
        }
           
        
    }
    
?>